/*
 * @Description:
 *
 * @Author: guichengcai<guichengcai>
 * @Date: 2023-07-03 17:10:22
 * @FilePath: /yuxiuproweb/src/api/reportforms/sale/index.js
 */
import request from "@/utils/request";

// 查询生产任务单
export function listRecord(query) {
  return request({
    url: "/qb/task/list",
    method: "get",
    params: query,
  });
}
// 新增生产任务单 备料新增
export function addTaskOrder(data) {
  return request({
    url: "/qb/task",
    method: "post",
    data: data,
  });
}
// 修改生产任务单
export function updateTaskOrder(data) {
  return request({
    url: "/qb/task",
    method: "put",
    data: data,
  });
}
//样册出库
export function updateOut(data) {
  return request({
    url: "/qb/task/outbound",
    method: "put",
    data: data,
  });
}
// 查询订单详细
export function getTaskOrder(proOrderId) {
  return request({
    url: "/qb/task/" + proOrderId,
    method: "get",
  });
}
// 新增销售订单
export function addOrder(data) {
  return request({
    url: "/qb/app/order/add",
    method: "post",
    data: data,
  });
}
// 修改销售单
export function updateOrder(data) {
  return request({
    url: "/qb/app/order/update",
    method: "put",
    data: data,
  });
}
// 获取销售单据
export function allList(data) {
  return request({
    url: "/qb/app/order/allList",
    method: "get",
    params: data,
  });
}
// 查询订单详细
export function getOrder(purchaseOrderId) {
  return request({
    url: "/qb/app/order/" + purchaseOrderId,
    method: "get",
  });
}
// 新增销售单item
export function addOrderItem(data) {
  return request({
    url: "/qb/product",
    method: "post",
    data: data,
  });
}
// 删除销售单item
export function deletOrderItem(productIds) {
  return request({
    url: "/qb/product/" + productIds,
    method: "delete",
  });
}
// 客服核对or财务核对(后台处理逻辑)
export function auditOrder(data) {
  return request({
    url: "/qb/app/order/audit",
    method: "get",
    params: data,
  });
}
// 关闭订单
export function closeOrder(data) {
  return request({
    url: "/qb/app/order/" + data,
    method: "delete",
    // params: data,
  });
}
// 取消关闭
export function nocloseOrder(data) {
  return request({
    url: "/qb/app/order/cancellation/" + data,
    method: "put",
    // params: data,
  });
}
// 销售单转任务单 参数：销售单id
export function toTaskOrder(data) {
  return request({
    url: "/qb/task/insertTaskList",
    method: "post",
    data: data,
  });
}
// 弃审
export function giveUpOrder(data) {
  return request({
    url: "/qb/app/order/backState",
    method: "put",
    data: data,
  });
}
export function changeOrder(data) {
  return request({
    url: "/qb/app/order/variation",
    method: "put",
    data: data,
  });
}
export function updateTaskIsPrint(data) {
  return request({
    url: "/qb/task/batchUpdate",
    method: "put",
    data: data,
  });
}
// 切换批号   库存id
export function changeBatchNumber(data) {
  return request({
    url: "/qb/task/batchNumber",
    method: "post",
    data: data,
  });
}
export function removeBatchNumber(data) {
  return request({
    url: "/qb/task/removeBatchNumber",
    method: "post",
    data: data,
  });
}
